﻿@model IEnumerable<OPM.Models.GetKnowledges>
@using OPM.Class;
@using System.Web.Mvc;

@{
    Layout = "~/Views/Shared/_LayoutInformation.cshtml";
}

<div class="tab_new_topic">
    <div class="tab_new_topic">
        <div class="mobile_menu floatL dNone" onclick="SlideMenu(1);"></div>
        <div class="new_topic_btn floatL" id="new_topic_btn4">@Multi.information</div>
        <div class="new_topic_btn floatR" id="new_topic_btn3"><a href="service.html">@Multi.NewSubject</a></div>
        <div class="clear"></div>
    </div>
</div>
<div class="titleTab knowledge_tab">
    <div class="titleTab_knowledge ">
        @Multi.ShowInformation 
        <select name="sue-staus" id="sue-staus">
            <option value="0">@Multi.select</option>
        </select>@*@Html.DropDownList("cboGroup", (SelectList)ViewBag.listOfSecret, "เลือก", null)*@
    </div>
</div>
<div class="p-Relative timeLineZone">
    <div class="p-Absolute timelineMore dNone" onclick="loadTimeline();">More</div>
    <div class="p-Absolute center-line"></div>

    @foreach (dynamic list in Model)
    {
        <div class="timeLineBox p-Relative floatL dNone timeLineBoxLeft" data-id="@list.id"></div>
    }

</div>

<script type="text/javascript">

    function loadTimeline() {
        var step = 0;
        var limitPage = $('.timeLineBox').length;
            limitPage--;
        $(".timeLineZone div").remove('.clear');
        checkLoadTimeline = false;
        $('.timeLineZone .timeLineBox:hidden').each(function (i, item) {
            var blockid = $(this).attr('data-id');

            $.get("@Url.Content("~/Information/Source")", { id: blockid })
				.done(function (data) {
				    $(".timeLineBox[data-id='" + blockid + "']").html(data).show().find("time.timeago").timeago();
				    var countRow = $(".timeLineBox[data-id='" + blockid + "'] .knowledge-Detail").find('p').length;
				    if (countRow > 1) {
				        $(".timeLineBox[data-id='" + blockid + "'] .knowledge-more").show();
				    }

				    if (step == limitPage) {
				        masonry();
				    } else {
				        step++;
				    }
				});
            if (i >= limitPage) {
                return false;
            }
        });
    }

</script>



